<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Installation Instructions - Fuel Documentation</title>
	<link href="../assets/css/main.css" media="screen" rel="stylesheet" />
	<script type="text/javascript" src="../assets/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="../assets/js/nav.js"></script>
	<script type="text/javascript" src="../assets/js/highlight.pack.js"></script>
	<script type="text/javascript">
		$(function() {
			show_nav('installation', '../');
		});
		hljs.tabReplace = '    ';
		hljs.initHighlightingOnLoad();
	</script>
</head>
<body>

	<header>
		<h1>Fuel Documentation</h1>
	</header>

	<div id="main-nav"></div>

	<section id="content">
		<h5>Choose One: <a href="#command">Command Line Installation</a> | <a href="#manual">Manual Installation</a></h5>
		<br />
		<h2 id="command">Command Line Installation</h2>
    <p class="note">This currently only works on *nix systems (Linux, OS X, Unix, etc).</p>
		<p>Our quick installer is a stripped down interface for the Oil package.  It allows you to create a new project with one command.  You will also no longer need to use 'php' in your oil commands.</p>

		<p>To install the quick installer simply open up a shell and run the following command:</p>
		
		<pre class="cli">$ curl get.fuelphp.com/oil | sh</pre>
		
		<p class="note">This will ask for your password, as it installs the script too /usr/bin.</p>
		
		<p>Now you can just use 'oil' instead of 'php oil' in your projects.</p>

		<p>To create a new project simply run:</p>

		<pre class="cli">$ oil create &lt;project_name&gt;</pre>
		
		<p>This will create a folder in the directory you are in with the project name you gave.  It will then clone the repository and all submodules into that directory.</p>
		
		<p>Note: This will also run <kbd>$ oil refine install</kbd>, which makes the necessary directories writable.</p>

		<h2 id="manual">Manual Installation Instructions</h2>

		<p>This will create the default installation of the Fuel framework on your web server.</p>

		<ol>
			<li><a href="download.html">Download the Fuel Framework</a></li>
			<li>Unzip/Extract the download</li>
			<li>Move the files to your server
				<ul>
					<li>Note the public directory in the source equals your web server's public document directory i.e.
					public_html, public, htdocs, etc. Move its contents to there or a subdirectory of the webroot
					where you want to use Fuel.</li>
					<li>Placing the fuel directory outside of the public document directory is encouraged for security
					reasons.</li>
					<li>Edit the paths in index.php to point to your app, core & packages directories.</li>
				</ul>
<pre>/
  fuel/
    app/
    core/
    packages/
  public/
    .htaccess
    assets/
    index.php
  oil
</pre>
			</li>
			<li>
				Set permissions on writable folders manually, or run:
<pre>$ php oil refine install
	Made writable: APPPATH/cache
	Made writable: APPPATH/logs
	Made writable: APPPATH/tmp
</pre>
			</li>
		</ol>

		<h2 id="configuration">Configuration</h2>

		<p>The main configuration can be found at app/config/config.php. Edit it to your liking.</p>

		<h2 id="install_inside_root">Install inside the document root</h2>

		<p>As explained in point 3, for security reasons it is strongly advised NOT to install Fuel inside your webserver's document root.</p>
		<p>
			However, there are cases where you would like to do that, for example for a (local) development environment where Apache's dynamic mass virtual hosting module
			is used to quickly setup new development environments without the need to restart the webserver.
		</p>
		<p>In that case, you need an additional .htaccess file that you need to place in your document root, which will redirect requests to the site root to your public folder, and also modifies the rewrites to include the public folder:</p>
<pre>
&lt;IfModule mod_rewrite.c>
	RewriteEngine on

	RewriteBase /public

	RewriteRule ^(/)?$ index.php/$1 [L]

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d

	RewriteRule ^(.*)$ index.php/$1 [L]
&lt;/IfModule>
</pre>
		
		<h2 id="setting_the_environment">Setting the Environment</h2>
		
		<p>
			By default, the environment is set to Development mode. Fuel uses the environment to define which database settings to use, but you can use it for other things.
		</p>
		<p>
			To set the environment, drop the following line into your .htaccess file.
		</p>
		<pre>SetEnv FUEL_ENV production</pre>
		<p>
			Available options are detailed in the <a href="../classes/fuel.html#class_constants">Class constants</a> of the Fuel Class.
		</p>

	</section>

	<section id="footer">
		<p>
			<a href="http://fuelphp.com">Fuel</a> is released under the MIT license.<br />
			&copy; 2010 - 2011 Fuel Development Team
		</p>
	</section>

</body>
</html>
